<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('道路基本信息列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                                    <li>
                                        <label>路线Py：</label>
                                        <input type="text" name="firstRoadName"/>
                                    </li>
                                    <li>
                                        <label>路线：</label>
                                        <input type="text" name="chroadName"/>
                                    </li>
                                    <li>
                                        <label>公司Py：</label>
                                        <input type="text" name="companyName"/>
                                    </li>
                                    <li>
                                        <label>公司：</label>
                                        <input type="text" name="company"/>
                                    </li>
                                    <li>
                                        <label>公司排序：</label>
                                        <input type="text" name="companySort"/>
                                    </li>
                                    <li>
                                        <label>路段：</label>
                                        <input type="text" name="roadName"/>
                                    </li>
                                    <li>
                                        <label>路线编号：</label>
                                        <input type="text" name="sectionId"/>
                                    </li>
                                    <li>
                                        <label>启点：</label>
                                        <input type="text" name="startName"/>
                                    </li>
                                    <li>
                                        <label>终点：</label>
                                        <input type="text" name="endName"/>
                                    </li>
                                    <li>
                                        <label>路线地区：</label>
                                        <input type="text" name="location"/>
                                    </li>
                                    <li>
                                        <label>起点桩号：</label>
                                        <input type="text" name="startpilenumber"/>
                                    </li>
                                    <li>
                                        <label>终点桩号：</label>
                                        <input type="text" name="endpilenumber"/>
                                    </li>
                                    <li>
                                        <label>排序：</label>
                                        <input type="text" name="sort"/>
                                    </li>
                                    <li>
                                        <label>开始年：</label>
                                        <input type="text" name="starttime"/>
                                    </li>
                                    <li>
                                        <label>路面结构：</label>
                                        <select name="stru"
                                                th:with="type=${@dict.getType('load_stru')}">
                                            <option value="">所有</option>
                                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                                    th:value="${dict.dictValue}"></option>
                                        </select>
                                    </li>
                                    <li>
                                        <label>通车日期：</label>
                                        <input type="text" name="opentime"/>
                                    </li>
                                    <li>
                                        <label>衰变系数：</label>
                                        <input type="text" name="suai"/>
                                    </li>
                                    <li class="select-time">
                                        <label>创建时间：</label>
                                        <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                               name="params[beginCreateDate]"/>
                                        <span>-</span>
                                        <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                               name="params[endCreateDate]"/>
                                    </li>
                                    <li class="select-time">
                                        <label>更新时间：</label>
                                        <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                               name="params[beginUpdateDate]"/>
                                        <span>-</span>
                                        <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                               name="params[endUpdateDate]"/>
                                    </li>
                                    <li>
                                        <label>备注信息：</label>
                                        <input type="text" name="remarks"/>
                                    </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="road:information:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="road:information:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="road:information:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="road:information:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('road:information:edit')}]];
    var removeFlag = [[${@permission.hasPermi('road:information:remove')}]];
            var struDatas = [[${@dict.getType('load_stru')}]];
    var prefix = ctx + "road/information";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "道路基本信息",
            columns: [{
                checkbox: true
            },
                        {
                            field: 'id',
                            title: '主键',
                            visible: false
                        },
                        {
                            field: 'firstRoadName',
                            title: '路线Py'
                        },
                        {
                            field: 'chroadName',
                            title: '路线'
                        },
                        {
                            field: 'companyName',
                            title: '公司Py'
                        },
                        {
                            field: 'company',
                            title: '公司'
                        },
                        {
                            field: 'companySort',
                            title: '公司排序'
                        },
                        {
                            field: 'roadName',
                            title: '路段'
                        },
                        {
                            field: 'sectionId',
                            title: '路线编号'
                        },
                        {
                            field: 'startName',
                            title: '启点'
                        },
                        {
                            field: 'endName',
                            title: '终点'
                        },
                        {
                            field: 'location',
                            title: '路线地区'
                        },
                        {
                            field: 'startpilenumber',
                            title: '起点桩号'
                        },
                        {
                            field: 'endpilenumber',
                            title: '终点桩号'
                        },
                        {
                            field: 'sort',
                            title: '排序'
                        },
                        {
                            field: 'starttime',
                            title: '开始年'
                        },
                        // {
                        //     field: 'stru',
                        //     title: '路面结构',
                        //     formatter: function (value, row, index) {
                        //         return $.table.selectDictLabel(struDatas, value);
                        //     }
                        // },
                        {
                            field: 'opentime',
                            title: '通车日期'
                        },
                        {
                            field: 'suai',
                            title: '衰变系数'
                        },
                        {
                            field: 'createDate',
                            title: '创建时间'
                        },
                        {
                            field: 'updateDate',
                            title: '更新时间'
                        },
                        {
                            field: 'remarks',
                            title: '备注信息'
                        },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>
